<!DOCTYPE html>
<html lang="en" style="font-size: 79.5424px;">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>游戏体验</title>
    <script type="text/javascript">
        var arrayLipstick = ["#(ctxWapSt)/img/Lipstick_1.png","#(ctxWapSt)/img/Lipstick_2.png","#(ctxWapSt)/img/Lipstick_3.png"];
        //中心圆资源数组
        var arrayCenterCircle = ["#(ctxWapSt)/img/CircleCenter_1.png","#(ctxWapSt)/img/CircleCenter_2.png","#(ctxWapSt)/img/CircleCenter_3.png"];
        //关卡资源
        var levelUrl = [
            {"normal":"#(ctxWapSt)/img/level_icon_1_active.png","active":"#(ctxWapSt)/img/level_icon_1_active.png"},
            {"normal":"#(ctxWapSt)/img/level_icon_2.png","active":"#(ctxWapSt)/img/level_icon_2_active.png"},
            {"normal":"#(ctxWapSt)/img/level_icon_3.png","active":"#(ctxWapSt)/img/level_icon_3_active.png"}
        ];
         var CircleCenterSplit = [
             {"left":{"url":"#(ctxWapSt)/img/CircleCenter_1_split_left.png","w":"238","h":"407","rs":Math.PI*2},
              "right":{"url":"#(ctxWapSt)/img/CircleCenter_1_split_right.png","w":"230","h":"407","cutx":"26","rs":Math.PI*2}},
             {"left":{"url":"#(ctxWapSt)/img/CircleCenter_2_split_left.png","w":"238","h":"407","rs":Math.PI*2},
              "right":{"url":"#(ctxWapSt)/img/CircleCenter_2_split_right.png","w":"230","h":"407","cutx":"26","rs":Math.PI*2}},
             {"left":{"url":"#(ctxWapSt)/img/CircleCenter_3_split_left.png","w":"238","h":"407","rs":Math.PI*2},
              "right":{"url":"#(ctxWapSt)/img/CircleCenter_3_split_right.png","w":"230","h":"407","cutx":"26","rs":Math.PI*2}},
         ];
        var gamesmain={
        "Level1_PARAMETERS":{
            "ROTAION_SPEED_ARRAY" : [-0.05,-0.04,-0.02,0.02,0.04,0.05],
            "rotationAccelerationSpeed" : 0.001,
            "levelArray":[0,#(game.number[0]),#(game.speed[0]),#(game.usetime[0])]
            /*"levelArray":[0,2,0.02,30]*/
        },
        "Level2_PARAMETERS":{
             "ROTAION_SPEED_ARRAY" : [-0.06,-0.03,-0.02,0.02,0.04,0.06],
            "rotationAccelerationSpeed" : 0.001,
            "levelArray":[0,#(game.number[1]),#(game.speed[1]),#(game.usetime[1])]
            /*"levelArray":[0,2,0.04,40]*/
        },
        "Level3_PARAMETERS":{
            "ROTAION_SPEED_ARRAY" : [-0.08,-0.07,-0.05,0.06,0.08,0.08],
            "rotationAccelerationSpeed" : 0.008,
            "levelArray":[0,#(game.number[2]),#(game.speed[2]),#(game.usetime[2])]
            /*"levelArray":[0,5,0.06,60]*/
        }        
    }

    </script>
    <link rel="stylesheet" href="#(ctxWapSt)/css/game.css?v=#(timestamp)">
    <script type="text/javascript" src="#(ctxWapSt)/js/bodymovin.js?v=#(timestamp)"></script>
    <script type="text/javascript" src="#(ctxWapSt)/js/jweixin-1.3.2.js?v=#(timestamp)"></script>
    <script typet="text/javascript" src="#(ctxWapSt)/js/jquery-3.3.1.min.js?v=#(timestamp)"></script>
    <script type="text/javascript" src="#(ctxWapSt)/js/jquery.cookie.js?v=#(timestamp)"></script>
    <script type="text/javascript" src="#(ctxWapSt)/js/JicemoonMobileTouch.js?v=#(timestamp)"></script>
    <script type="text/javascript" src="#(ctxWapSt)/js/HardestGame1.js?v=#(timestamp)"></script>
    <script type="text/javascript" src="#(ctxWapSt)/js/index1.js?v=#(timestamp)"></script>
</head>
<body>
    <audio id="back_music" preload="" src="#(ctxWapSt)/audio/bg_audio.mp3" loop="true"></audio>
    <audio id="split_audio" preload="" src="#(ctxWapSt)/audio/split_audio.mp3"></audio>
    <audio id="collision_audio" preload="" src="#(ctxWapSt)/audio/collision_audio.mp3"></audio>
    <audio id="Countdown_10s_audio" preload="" src="#(ctxWapSt)/audio/Countdown_10s_audio.mp3"></audio>
    <audio id="gameFail_audio" preload="" src="#(ctxWapSt)/audio/gameFail_audio.mp3"></audio>
    <audio id="gameSuccess_audio" preload="" src="#(ctxWapSt)/audio/gameSuccess_audio.mp3"></audio>
    <audio id="insert_audio" preload="" src="#(ctxWapSt)/audio/insert_audio.mp3"></audio>
    <audio id="success_audio" preload="" src="#(ctxWapSt)/audio/success_audio.mp3"></audio>

    <div class="levelSwitchBox" id="levelSwitchBox" style="display: block;">
        <img id="levelSwitchBoxMain" class="levelSwitchBoxMain" src="#(ctxWapSt)/img/level_1_main.jpg">
    </div>
    <div class="PopupBox" id="gameOverBox" style="display: none;">
        <!--<div class="gameOverIcon"></div>-->
        <div id="gameOverBoxTitle">闯关失败</div>
        <div class="PopupBoxBtn" id="gameOverBoxBtn">重新闯关</div>
    </div>
    <div class="PopupBox" id="gameSuccessBox" style="display: none;">
        <div id="gameSuccessBoxText">体验结束</div>
        <div class="PopupBoxBtn" id="gameSuccessBoxBtn">马上闯关</div>
    </div>

    <div class="layoutRoot" id="app" style="background:url(#(ctxWapSt)/img/bg.jpg) no-repeat;background-size:100% 100%;">
        <div class="game" id="game" style="width: 596px; height: 938px;">
            <div class="account">
                <span></span>
            </div>
            <canvas style="position: relative;z-index: 3" id="gameStage" width="596" height="938"></canvas>
            <div id="bm" style="width: 100%; height: 100%;position: fixed;background-color: rgba(0,0,0,0);top: 5.3rem; transform: translate(-5%,-1%); z-index: 2">
            </div>
            <div class="tips">
                <p id="currentLevel">当前关数: <span>2</span></p>
                <p id="gameTip"></p>
            </div>

            <div class="levelbox" id="levelbox">
                <div class="level"><img id="level_1" src="#(ctxWapSt)/img/level_1_main.jpg?v=#(timestamp)"></div>
	            <div class="level"><img id="level_2" src="#(ctxWapSt)/img/level_2_mains.jpg?v=#(timestamp)"></div>
	            <div class="level"><img id="level_3" src="#(ctxWapSt)/img/level_3.png?v=#(timestamp)"></div>
            </div>
            <div id="timebox" style="background:url(#(ctxWapSt)/img/timebox_bg.png) no-repeat;background-size:100% 100%;color:#ffffff">15</div>
        </div>
    </div>

<script type="text/javascript">
    var loadedMusic = false;
    document.body.addEventListener('touchmove', function (e) {
        e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)
    }, {passive: false});
    var baseUrl = function GetRequest() {
        var url = location.search;  //获取url中"?"符后的字符串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            url = url.split("?")[1];
            strs = url.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
            }
        }
        return theRequest;

    }
    var columnsLipstick=[
        {"normal":"#(ctxWapSt)/img/Sword_small_1.png","active":"#(ctxWapSt)/img/Sword_small_1_gray.png"},
        {"normal":"#(ctxWapSt)/img/Sword_small_2.png","active":"#(ctxWapSt)/img/Sword_small_2_gray.png"},
        {"normal":"#(ctxWapSt)/img/Sword_small_3.png","active":"#(ctxWapSt)/img/Sword_small_3_gray.png"}
    ];
    var levels_mains=[
        "#(ctxWapSt)/img/level_1_main.jpg","#(ctxWapSt)/img/level_2_mains.jpg","#(ctxWapSt)/img/level_2_mains.jpg"
    ]
    var jsonParamsAlias = baseUrl();
    // var jsonParams = {
    //     "game_id" : jsonParamsAlias.gid,
    //     "game_pay" : jsonParamsAlias.pay,
    //     "product_id" : jsonParamsAlias.pid,
    //     "randomNum" : jsonParamsAlias.rand,
    //     "forecast_result": jsonParamsAlias.res,
    //     "user_id" : jsonParamsAlias.uid
    // }
    var jsonParams = {
        "game_id" : "",
        "game_pay" : "",
        "product_id" : "",
        "randomNum" : "",
        "forecast_result": "",
        "user_id" : ""
    }
    if (jsonParamsAlias.slient) {
        $('audio').prop('muted', true);
    }
    if (jsonParamsAlias.h5 && jsonParamsAlias.h5 == "1") {
        window.isH5 = true;
    }
    var cookieDelTime = new Date(Math.floor(new Date(new Date().getTime()+150000)));
    $.cookie('game_cookie', null);
    $.cookie('game_cookie', JSON.stringify(jsonParams), { expires: cookieDelTime });
    var anim = bodymovin.loadAnimation({
        wrapper: document.querySelector('#bm'),
        animType: 'svg',
        loop: false,
        autoplay: false,
        prerender: true,
        path: '#(ctxWapSt)/data.json'
    });
    function play(){
        anim.goToAndStop(0, true)
        anim.play()
    }
    document.addEventListener('DOMContentLoaded', function () {
        audioAutoPlay();
    });

    function audioAutoPlay() {
        var audio = document.getElementById('back_music');
        audio.play();
        document.addEventListener("WeixinJSBridgeReady", function () {
            audio.play();
        }, false);
    }
    document.addEventListener('visibilitychange', function(e) {
        function audioStop() {
            var audio = document.getElementById('back_music');
            document.hidden ? audio.pause() : audio.play();
            document.addEventListener("WeixinJSBridgeReady", function () {
                document.hidden ? audio.pause() : audio.play();
            }, false);
        }
        audioStop();
    });

</script>
</body>
</html>